<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>SoupMessageBody</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="libsoup Reference Manual">
<link rel="up" href="ch02.html" title="Core API">
<link rel="prev" href="SoupMessageHeaders.html" title="SoupMessageHeaders">
<link rel="next" href="libsoup-2.4-soup-method.html" title="soup-method">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="SoupMessageHeaders.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libsoup Reference Manual</th>
<td><a accesskey="n" href="libsoup-2.4-soup-method.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#SoupMessageBody.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#SoupMessageBody.description" class="shortcut">Description</a>
                   | 
                  <a href="#SoupMessageBody.object-hierarchy" class="shortcut">Object Hierarchy</a>
</td></tr>
</table>
<div class="refentry">
<a name="SoupMessageBody"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="SoupMessageBody.top_of_page"></a>SoupMessageBody</span></h2>
<p>SoupMessageBody — HTTP message body</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="SoupMessageBody.synopsis"></a><h2>Synopsis</h2>
<a name="SoupBuffer"></a><pre class="synopsis">
#include &lt;libsoup/soup.h&gt;

                    <a class="link" href="SoupMessageBody.html#SoupBuffer-struct" title="SoupBuffer">SoupBuffer</a>;
enum                <a class="link" href="SoupMessageBody.html#SoupMemoryUse" title="enum SoupMemoryUse">SoupMemoryUse</a>;
<a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="returnvalue">SoupBuffer</span></a> *        <a class="link" href="SoupMessageBody.html#soup-buffer-new" title="soup_buffer_new ()">soup_buffer_new</a>                     (<em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupMemoryUse" title="enum SoupMemoryUse"><span class="type">SoupMemoryUse</span></a> use</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gconstpointer"><span class="type">gconstpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>);
<a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="returnvalue">SoupBuffer</span></a> *        <a class="link" href="SoupMessageBody.html#soup-buffer-new-subbuffer" title="soup_buffer_new_subbuffer ()">soup_buffer_new_subbuffer</a>           (<em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> *parent</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> offset</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>);
<a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="returnvalue">SoupBuffer</span></a> *        <a class="link" href="SoupMessageBody.html#soup-buffer-new-with-owner" title="soup_buffer_new_with_owner ()">soup_buffer_new_with_owner</a>          (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gconstpointer"><span class="type">gconstpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> owner</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> owner_dnotify</code></em>);
<a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="returnvalue">SoupBuffer</span></a> *        <a class="link" href="SoupMessageBody.html#soup-buffer-new-take" title="soup_buffer_new_take ()">soup_buffer_new_take</a>                (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> *data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="SoupMessageBody.html#soup-buffer-get-owner" title="soup_buffer_get_owner ()">soup_buffer_get_owner</a>               (<em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> *buffer</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupMessageBody.html#soup-buffer-get-data" title="soup_buffer_get_data ()">soup_buffer_get_data</a>                (<em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *length</code></em>);
<a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="returnvalue">SoupBuffer</span></a> *        <a class="link" href="SoupMessageBody.html#soup-buffer-copy" title="soup_buffer_copy ()">soup_buffer_copy</a>                    (<em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> *buffer</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupMessageBody.html#soup-buffer-free" title="soup_buffer_free ()">soup_buffer_free</a>                    (<em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> *buffer</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GBytes"><span class="returnvalue">GBytes</span></a> *            <a class="link" href="SoupMessageBody.html#soup-buffer-get-as-bytes" title="soup_buffer_get_as_bytes ()">soup_buffer_get_as_bytes</a>            (<em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> *buffer</code></em>);

                    <a class="link" href="SoupMessageBody.html#SoupMessageBody-struct" title="SoupMessageBody">SoupMessageBody</a>;
<a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="returnvalue">SoupMessageBody</span></a> *   <a class="link" href="SoupMessageBody.html#soup-message-body-new" title="soup_message_body_new ()">soup_message_body_new</a>               (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupMessageBody.html#soup-message-body-free" title="soup_message_body_free ()">soup_message_body_free</a>              (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>);

<span class="returnvalue">void</span>                <a class="link" href="SoupMessageBody.html#soup-message-body-set-accumulate" title="soup_message_body_set_accumulate ()">soup_message_body_set_accumulate</a>    (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> accumulate</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="SoupMessageBody.html#soup-message-body-get-accumulate" title="soup_message_body_get_accumulate ()">soup_message_body_get_accumulate</a>    (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>);

<span class="returnvalue">void</span>                <a class="link" href="SoupMessageBody.html#soup-message-body-append" title="soup_message_body_append ()">soup_message_body_append</a>            (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupMemoryUse" title="enum SoupMemoryUse"><span class="type">SoupMemoryUse</span></a> use</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gconstpointer"><span class="type">gconstpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupMessageBody.html#soup-message-body-append-buffer" title="soup_message_body_append_buffer ()">soup_message_body_append_buffer</a>     (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> *buffer</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupMessageBody.html#soup-message-body-append-take" title="soup_message_body_append_take ()">soup_message_body_append_take</a>       (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> *data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupMessageBody.html#soup-message-body-truncate" title="soup_message_body_truncate ()">soup_message_body_truncate</a>          (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupMessageBody.html#soup-message-body-complete" title="soup_message_body_complete ()">soup_message_body_complete</a>          (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>);
<a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="returnvalue">SoupBuffer</span></a> *        <a class="link" href="SoupMessageBody.html#soup-message-body-flatten" title="soup_message_body_flatten ()">soup_message_body_flatten</a>           (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>);
<a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="returnvalue">SoupBuffer</span></a> *        <a class="link" href="SoupMessageBody.html#soup-message-body-get-chunk" title="soup_message_body_get_chunk ()">soup_message_body_get_chunk</a>         (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#goffset"><span class="type">goffset</span></a> offset</code></em>);

<span class="returnvalue">void</span>                <a class="link" href="SoupMessageBody.html#soup-message-body-got-chunk" title="soup_message_body_got_chunk ()">soup_message_body_got_chunk</a>         (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> *chunk</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupMessageBody.html#soup-message-body-wrote-chunk" title="soup_message_body_wrote_chunk ()">soup_message_body_wrote_chunk</a>       (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> *chunk</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="SoupMessageBody.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  GBoxed
   +----SoupBuffer
</pre>
<pre class="synopsis">
  GBoxed
   +----SoupMessageBody
</pre>
</div>
<div class="refsect1">
<a name="SoupMessageBody.description"></a><h2>Description</h2>
<p>
<a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> represents the request or response body of a
<a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a>.
</p>
<p>
In addition to <a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a>, libsoup also defines a "smaller"
data buffer type, <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a>, which is primarily used as a
component of <a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a>. In particular, when using chunked
encoding to transmit or receive a message, each chunk is
represented as a <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a>.
</p>
</div>
<div class="refsect1">
<a name="SoupMessageBody.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="SoupBuffer-struct"></a><h3>SoupBuffer</h3>
<pre class="programlisting">typedef struct {
	const char *data;
	gsize       length;
} SoupBuffer;
</pre>
<p>
A data buffer, generally used to represent a chunk of a
<a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a>.
</p>
<p>
<em class="parameter"><code>data</code></em> is a <span class="type">char</span> because that's generally convenient; in some
situations you may need to cast it to <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> or another type.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term">const <span class="type">char</span> *<em class="structfield"><code><a name="SoupBuffer-struct.data"></a>data</code></em>;</span></p></td>
<td>the data. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> gpointer]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> <em class="structfield"><code><a name="SoupBuffer-struct.length"></a>length</code></em>;</span></p></td>
<td>length of <em class="parameter"><code>data</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="SoupMemoryUse"></a><h3>enum SoupMemoryUse</h3>
<pre class="programlisting">typedef enum {
	SOUP_MEMORY_STATIC,
	SOUP_MEMORY_TAKE,
	SOUP_MEMORY_COPY,
	SOUP_MEMORY_TEMPORARY
} SoupMemoryUse;
</pre>
<p>
Describes how <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> should use the data passed in by the
caller.
</p>
<p>
See also <a class="link" href="SoupMessageBody.html#soup-buffer-new-with-owner" title="soup_buffer_new_with_owner ()"><code class="function">soup_buffer_new_with_owner()</code></a>, which allows to you create a
buffer containing data which is owned by another object.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="SOUP-MEMORY-STATIC:CAPS"></a><span class="term"><code class="literal">SOUP_MEMORY_STATIC</code></span></p></td>
<td>The memory is statically allocated and
constant; libsoup can use the passed-in buffer directly and not
need to worry about it being modified or freed.
</td>
</tr>
<tr>
<td><p><a name="SOUP-MEMORY-TAKE:CAPS"></a><span class="term"><code class="literal">SOUP_MEMORY_TAKE</code></span></p></td>
<td>The caller has allocated the memory for the
<a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a>'s use; libsoup will assume ownership of it and free it
(with <a href="http://library.gnome.org/devel/glib/unstable/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>) when it is done with it.
</td>
</tr>
<tr>
<td><p><a name="SOUP-MEMORY-COPY:CAPS"></a><span class="term"><code class="literal">SOUP_MEMORY_COPY</code></span></p></td>
<td>The passed-in data belongs to the caller; the
<a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> will copy it into new memory, leaving the caller free
to reuse the original memory.
</td>
</tr>
<tr>
<td><p><a name="SOUP-MEMORY-TEMPORARY:CAPS"></a><span class="term"><code class="literal">SOUP_MEMORY_TEMPORARY</code></span></p></td>
<td>The passed-in data belongs to the caller,
but will remain valid for the lifetime of the <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a>. The
difference between this and <em class="parameter"><code>SOUP_MEMORY_STATIC</code></em> is that if you copy
a <em class="parameter"><code>SOUP_MEMORY_TEMPORARY</code></em> buffer, it will make a copy of the memory
as well, rather than reusing the original memory.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-buffer-new"></a><h3>soup_buffer_new ()</h3>
<pre class="programlisting"><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="returnvalue">SoupBuffer</span></a> *        soup_buffer_new                     (<em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupMemoryUse" title="enum SoupMemoryUse"><span class="type">SoupMemoryUse</span></a> use</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gconstpointer"><span class="type">gconstpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>);</pre>
<p>
Creates a new <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> containing <em class="parameter"><code>length</code></em> bytes from <em class="parameter"><code>data</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>use</code></em> :</span></p></td>
<td>how <em class="parameter"><code>data</code></em> is to be used by the buffer</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>data</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>length of <em class="parameter"><code>data</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the new <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-buffer-new-subbuffer"></a><h3>soup_buffer_new_subbuffer ()</h3>
<pre class="programlisting"><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="returnvalue">SoupBuffer</span></a> *        soup_buffer_new_subbuffer           (<em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> *parent</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> offset</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>);</pre>
<p>
Creates a new <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> containing <em class="parameter"><code>length</code></em> bytes "copied" from
<em class="parameter"><code>parent</code></em> starting at <em class="parameter"><code>offset</code></em>. (Normally this will not actually copy
any data, but will instead simply reference the same data as
<em class="parameter"><code>parent</code></em> does.)
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
<td>the parent <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>offset</code></em> :</span></p></td>
<td>offset within <em class="parameter"><code>parent</code></em> to start at</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>number of bytes to copy from <em class="parameter"><code>parent</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the new <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-buffer-new-with-owner"></a><h3>soup_buffer_new_with_owner ()</h3>
<pre class="programlisting"><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="returnvalue">SoupBuffer</span></a> *        soup_buffer_new_with_owner          (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gconstpointer"><span class="type">gconstpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> owner</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> owner_dnotify</code></em>);</pre>
<p>
Creates a new <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> containing <em class="parameter"><code>length</code></em> bytes from <em class="parameter"><code>data</code></em>. When
the <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> is freed, it will call <em class="parameter"><code>owner_dnotify</code></em>, passing
<em class="parameter"><code>owner</code></em> to it. You must ensure that <em class="parameter"><code>data</code></em> will remain valid until
<em class="parameter"><code>owner_dnotify</code></em> is called.
</p>
<p>
For example, you could use this to create a buffer containing data
returned from libxml without needing to do an extra copy:
</p>
<p>
</p>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="function">xmlDocDumpMemory</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">doc</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&amp;</span><span class="normal">xmlbody</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&amp;</span><span class="normal">len</span><span class="symbol">);</span>
<span class="keyword">return</span><span class="normal"> </span><span class="function"><a href="SoupMessageBody.html#soup-buffer-new-with-owner">soup_buffer_new_with_owner</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">xmlbody</span><span class="symbol">,</span><span class="normal"> len</span><span class="symbol">,</span><span class="normal"> xmlbody</span><span class="symbol">,</span>
<span class="normal">                                   </span><span class="symbol">(</span><span class="normal"><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify">GDestroyNotify</a></span><span class="symbol">)</span><span class="normal">xmlFree</span><span class="symbol">);</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p>
</p>
<p>
In this example, <em class="parameter"><code>data</code></em> and <em class="parameter"><code>owner</code></em> are the same, but in other cases
they would be different (eg, <em class="parameter"><code>owner</code></em> would be a object, and <em class="parameter"><code>data</code></em>
would be a pointer to one of the object's fields).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>data</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>length of <em class="parameter"><code>data</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>owner</code></em> :</span></p></td>
<td>pointer to an object that owns <em class="parameter"><code>data</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>owner_dnotify</code></em> :</span></p></td>
<td>a function to free/unref <em class="parameter"><code>owner</code></em> when
the buffer is freed. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the new <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-buffer-new-take"></a><h3>soup_buffer_new_take ()</h3>
<pre class="programlisting"><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="returnvalue">SoupBuffer</span></a> *        soup_buffer_new_take                (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> *data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>);</pre>
<p>
Creates a new <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> containing <em class="parameter"><code>length</code></em> bytes from <em class="parameter"><code>data</code></em>.
</p>
<p>
This function is exactly equivalent to <a class="link" href="SoupMessageBody.html#soup-buffer-new" title="soup_buffer_new ()"><code class="function">soup_buffer_new()</code></a> with
<a class="link" href="SoupMessageBody.html#SOUP-MEMORY-TAKE:CAPS"><code class="literal">SOUP_MEMORY_TAKE</code></a> as first argument; it exists mainly for
convenience and simplifying language bindings.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>data. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=length][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>length of <em class="parameter"><code>data</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the new <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a>.
Rename to: soup_buffer_new</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.32</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-buffer-get-owner"></a><h3>soup_buffer_get_owner ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            soup_buffer_get_owner               (<em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> *buffer</code></em>);</pre>
<p>
Gets the "owner" object for a buffer created with
<a class="link" href="SoupMessageBody.html#soup-buffer-new-with-owner" title="soup_buffer_new_with_owner ()"><code class="function">soup_buffer_new_with_owner()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> created with <a class="link" href="SoupMessageBody.html#soup-buffer-new-with-owner" title="soup_buffer_new_with_owner ()"><code class="function">soup_buffer_new_with_owner()</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the owner pointer. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-buffer-get-data"></a><h3>soup_buffer_get_data ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_buffer_get_data                (<em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *length</code></em>);</pre>
<p>
This function exists for use by language bindings, because it's not
currently possible to get the right effect by annotating the fields
of <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>the pointer
to the buffer data is stored here. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=length][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>the length of the buffer data is stored here. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.32</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-buffer-copy"></a><h3>soup_buffer_copy ()</h3>
<pre class="programlisting"><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="returnvalue">SoupBuffer</span></a> *        soup_buffer_copy                    (<em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> *buffer</code></em>);</pre>
<p>
Makes a copy of <em class="parameter"><code>buffer</code></em>. In reality, <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> is a refcounted
type, and calling <a class="link" href="SoupMessageBody.html#soup-buffer-copy" title="soup_buffer_copy ()"><code class="function">soup_buffer_copy()</code></a> will normally just increment
the refcount on <em class="parameter"><code>buffer</code></em> and return it. However, if <em class="parameter"><code>buffer</code></em> was
created with <a class="link" href="SoupMessageBody.html#SOUP-MEMORY-TEMPORARY:CAPS"><span class="type">SOUP_MEMORY_TEMPORARY</span></a> memory, then <a class="link" href="SoupMessageBody.html#soup-buffer-copy" title="soup_buffer_copy ()"><code class="function">soup_buffer_copy()</code></a>
will actually return a copy of it, so that the data in the copy
will remain valid after the temporary buffer is freed.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the new (or newly-reffed) buffer</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-buffer-free"></a><h3>soup_buffer_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_buffer_free                    (<em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> *buffer</code></em>);</pre>
<p>
Frees <em class="parameter"><code>buffer</code></em>. (In reality, as described in the documentation for
<a class="link" href="SoupMessageBody.html#soup-buffer-copy" title="soup_buffer_copy ()"><code class="function">soup_buffer_copy()</code></a>, this is actually an "unref" operation, and may
or may not actually free <em class="parameter"><code>buffer</code></em>.)
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-buffer-get-as-bytes"></a><h3>soup_buffer_get_as_bytes ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GBytes"><span class="returnvalue">GBytes</span></a> *            soup_buffer_get_as_bytes            (<em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> *buffer</code></em>);</pre>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a> which has the same content
as the <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.40</p>
</div>
<hr>
<div class="refsect2">
<a name="SoupMessageBody-struct"></a><h3>SoupMessageBody</h3>
<pre class="programlisting">typedef struct {
	const char *data;
	goffset     length;
} SoupMessageBody;
</pre>
<p>
A <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> request or response body.
</p>
<p>
Note that while <em class="parameter"><code>length</code></em> always reflects the full length of the
message body, <em class="parameter"><code>data</code></em> is normally <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, and will only be filled in
after <a class="link" href="SoupMessageBody.html#soup-message-body-flatten" title="soup_message_body_flatten ()"><code class="function">soup_message_body_flatten()</code></a> is called. For client-side
messages, this automatically happens for the response body after it
has been fully read, unless you set the
<a class="link" href="SoupMessage.html#SOUP-MESSAGE-OVERWRITE-CHUNKS:CAPS"><code class="literal">SOUP_MESSAGE_OVERWRITE_CHUNKS</code></a> flags. Likewise, for server-side
messages, the request body is automatically filled in after being
read.
</p>
<p>
As an added bonus, when <em class="parameter"><code>data</code></em> is filled in, it is always terminated
with a '\0' byte (which is not reflected in <em class="parameter"><code>length</code></em>).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term">const <span class="type">char</span> *<em class="structfield"><code><a name="SoupMessageBody-struct.data"></a>data</code></em>;</span></p></td>
<td>the data</td>
</tr>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#goffset"><span class="type">goffset</span></a> <em class="structfield"><code><a name="SoupMessageBody-struct.length"></a>length</code></em>;</span></p></td>
<td>length of <em class="parameter"><code>data</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-message-body-new"></a><h3>soup_message_body_new ()</h3>
<pre class="programlisting"><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="returnvalue">SoupMessageBody</span></a> *   soup_message_body_new               (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Creates a new <a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a>. <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> uses this internally; you
will not normally need to call it yourself.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a>.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-message-body-free"></a><h3>soup_message_body_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_message_body_free              (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>);</pre>
<p>
Frees <em class="parameter"><code>body</code></em>. You will not normally need to use this, as
<a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> frees its associated message bodies automatically.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>body</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-message-body-set-accumulate"></a><h3>soup_message_body_set_accumulate ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_message_body_set_accumulate    (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> accumulate</code></em>);</pre>
<p>
Sets or clears the accumulate flag on <em class="parameter"><code>body</code></em>. (The default value is
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.) If set to <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, <em class="parameter"><code>body</code></em>'s <code class="literal">data</code> field will not be filled in
after the body is fully sent/received, and the chunks that make up
<em class="parameter"><code>body</code></em> may be discarded when they are no longer needed.
</p>
<p>
In particular, if you set this flag to <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> on an "incoming"
message body (that is, the <a class="link" href="SoupMessage.html#SoupMessage--response-body" title='The "response-body" property'><span class="type">"response_body"</span></a> of a
client-side message, or <a class="link" href="SoupMessage.html#SoupMessage--request-body" title='The "request-body" property'><span class="type">"request_body"</span></a> of a server-side
message), this will cause each chunk of the body to be discarded
after its corresponding <a class="link" href="SoupMessage.html#SoupMessage-got-chunk" title='The "got-chunk" signal'><span class="type">"got_chunk"</span></a> signal is emitted.
(This is equivalent to setting the deprecated
<a class="link" href="SoupMessage.html#SOUP-MESSAGE-OVERWRITE-CHUNKS:CAPS"><code class="literal">SOUP_MESSAGE_OVERWRITE_CHUNKS</code></a> flag on the message.)
</p>
<p>
If you set this flag to <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> on the <a class="link" href="SoupMessage.html#SoupMessage--response-body" title='The "response-body" property'><span class="type">"response_body"</span></a> of
a server-side message, it will cause each chunk of the body to be
discarded after its corresponding <a class="link" href="SoupMessage.html#SoupMessage-wrote-chunk" title='The "wrote-chunk" signal'><span class="type">"wrote_chunk"</span></a> signal
is emitted.
</p>
<p>
If you set the flag to <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> on the <a class="link" href="SoupMessage.html#SoupMessage--request-body" title='The "request-body" property'><span class="type">"request_body"</span></a> of a
client-side message, it will block the accumulation of chunks into
<em class="parameter"><code>body</code></em>'s <code class="literal">data</code> field, but it will not normally cause the chunks to
be discarded after being written like in the server-side
<a class="link" href="SoupMessage.html#SoupMessage--response-body" title='The "response-body" property'><span class="type">"response_body"</span></a> case, because the request body needs to
be kept around in case the request needs to be sent a second time
due to redirection or authentication. However, if you set the
<a class="link" href="SoupMessage.html#SOUP-MESSAGE-CAN-REBUILD:CAPS"><code class="literal">SOUP_MESSAGE_CAN_REBUILD</code></a> flag on the message, then the chunks will
be discarded, and you will be responsible for recreating the
request body after the <a class="link" href="SoupMessage.html#SoupMessage-restarted" title='The "restarted" signal'><span class="type">"restarted"</span></a> signal is emitted.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>body</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>accumulate</code></em> :</span></p></td>
<td>whether or not to accumulate body chunks in <em class="parameter"><code>body</code></em>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4.1</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-message-body-get-accumulate"></a><h3>soup_message_body_get_accumulate ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            soup_message_body_get_accumulate    (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>);</pre>
<p>
Gets the accumulate flag on <em class="parameter"><code>body</code></em>; see
<a class="link" href="SoupMessageBody.html#soup-message-body-set-accumulate" title="soup_message_body_set_accumulate ()"><code class="function">soup_message_body_set_accumulate()</code></a> for details.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>body</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the accumulate flag for <em class="parameter"><code>body</code></em>.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4.1</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-message-body-append"></a><h3>soup_message_body_append ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_message_body_append            (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupMemoryUse" title="enum SoupMemoryUse"><span class="type">SoupMemoryUse</span></a> use</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gconstpointer"><span class="type">gconstpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>);</pre>
<p>
Appends <em class="parameter"><code>length</code></em> bytes from <em class="parameter"><code>data</code></em> to <em class="parameter"><code>body</code></em> according to <em class="parameter"><code>use</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>body</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>use</code></em> :</span></p></td>
<td>how to use <em class="parameter"><code>data</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>data to append. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=length][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> guint8]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>length of <em class="parameter"><code>data</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-message-body-append-buffer"></a><h3>soup_message_body_append_buffer ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_message_body_append_buffer     (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> *buffer</code></em>);</pre>
<p>
Appends the data from <em class="parameter"><code>buffer</code></em> to <em class="parameter"><code>body</code></em>. (<a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> uses
<a href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffers</span></a> internally, so this is normally a constant-time
operation that doesn't actually require copying the data in
<em class="parameter"><code>buffer</code></em>.)
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>body</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-message-body-append-take"></a><h3>soup_message_body_append_take ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_message_body_append_take       (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> *data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>);</pre>
<p>
Appends <em class="parameter"><code>length</code></em> bytes from <em class="parameter"><code>data</code></em> to <em class="parameter"><code>body</code></em>.
</p>
<p>
This function is exactly equivalent to <a class="link" href="SoupMessageBody.html#soup-message-body-append" title="soup_message_body_append ()"><code class="function">soup_message_body_append()</code></a>
with <a class="link" href="SoupMessageBody.html#SOUP-MEMORY-TAKE:CAPS"><code class="literal">SOUP_MEMORY_TAKE</code></a> as second argument; it exists mainly for
convenience and simplifying language bindings.
</p>
<p>
Rename to: soup_message_body_append
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>body</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>data to append. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=length][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>length of <em class="parameter"><code>data</code></em>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.32</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-message-body-truncate"></a><h3>soup_message_body_truncate ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_message_body_truncate          (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>);</pre>
<p>
Deletes all of the data in <em class="parameter"><code>body</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>body</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-message-body-complete"></a><h3>soup_message_body_complete ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_message_body_complete          (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>);</pre>
<p>
Tags <em class="parameter"><code>body</code></em> as being complete; Call this when using chunked encoding
after you have appended the last chunk.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>body</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-message-body-flatten"></a><h3>soup_message_body_flatten ()</h3>
<pre class="programlisting"><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="returnvalue">SoupBuffer</span></a> *        soup_message_body_flatten           (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>);</pre>
<p>
Fills in <em class="parameter"><code>body</code></em>'s data field with a buffer containing all of the
data in <em class="parameter"><code>body</code></em> (plus an additional '\0' byte not counted by <em class="parameter"><code>body</code></em>'s
length field).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>body</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> containing the same data as <em class="parameter"><code>body</code></em>.
(You must free this buffer if you do not want it.)</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-message-body-get-chunk"></a><h3>soup_message_body_get_chunk ()</h3>
<pre class="programlisting"><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="returnvalue">SoupBuffer</span></a> *        soup_message_body_get_chunk         (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#goffset"><span class="type">goffset</span></a> offset</code></em>);</pre>
<p>
Gets a <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> containing data from <em class="parameter"><code>body</code></em> starting at <em class="parameter"><code>offset</code></em>.
The size of the returned chunk is unspecified. You can iterate
through the entire body by first calling
<a class="link" href="SoupMessageBody.html#soup-message-body-get-chunk" title="soup_message_body_get_chunk ()"><code class="function">soup_message_body_get_chunk()</code></a> with an offset of 0, and then on each
successive call, increment the offset by the length of the
previously-returned chunk.
</p>
<p>
If <em class="parameter"><code>offset</code></em> is greater than or equal to the total length of <em class="parameter"><code>body</code></em>,
then the return value depends on whether or not
<a class="link" href="SoupMessageBody.html#soup-message-body-complete" title="soup_message_body_complete ()"><code class="function">soup_message_body_complete()</code></a> has been called or not; if it has,
then <a class="link" href="SoupMessageBody.html#soup-message-body-get-chunk" title="soup_message_body_get_chunk ()"><code class="function">soup_message_body_get_chunk()</code></a> will return a 0-length chunk
(indicating the end of <em class="parameter"><code>body</code></em>). If it has not, then
<a class="link" href="SoupMessageBody.html#soup-message-body-get-chunk" title="soup_message_body_get_chunk ()"><code class="function">soup_message_body_get_chunk()</code></a> will return <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> (indicating that
<em class="parameter"><code>body</code></em> may still potentially have more data, but that data is not
currently available).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>body</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>offset</code></em> :</span></p></td>
<td>an offset</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-message-body-got-chunk"></a><h3>soup_message_body_got_chunk ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_message_body_got_chunk         (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> *chunk</code></em>);</pre>
<p>
Handles the <a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> part of receiving a chunk of data from
the network. Normally this means appending <em class="parameter"><code>chunk</code></em> to <em class="parameter"><code>body</code></em>, exactly
as with <a class="link" href="SoupMessageBody.html#soup-message-body-append-buffer" title="soup_message_body_append_buffer ()"><code class="function">soup_message_body_append_buffer()</code></a>, but if you have set
<em class="parameter"><code>body</code></em>'s accumulate flag to <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, then that will not happen.
</p>
<p>
This is a low-level method which you should not normally need to
use.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>body</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>chunk</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> received from the network</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4.1</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-message-body-wrote-chunk"></a><h3>soup_message_body_wrote_chunk ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_message_body_wrote_chunk       (<em class="parameter"><code><a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> *body</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> *chunk</code></em>);</pre>
<p>
Handles the <a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> part of writing a chunk of data to the
network. Normally this is a no-op, but if you have set <em class="parameter"><code>body</code></em>'s
accumulate flag to <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, then this will cause <em class="parameter"><code>chunk</code></em> to be
discarded to free up memory.
</p>
<p>
This is a low-level method which you should not need to use, and
there are further restrictions on its proper use which are not
documented here.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>body</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>chunk</code></em> :</span></p></td>
<td>a <a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> returned from <a class="link" href="SoupMessageBody.html#soup-message-body-get-chunk" title="soup_message_body_get_chunk ()"><code class="function">soup_message_body_get_chunk()</code></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4.1</p>
</div>
</div>
<div class="refsect1">
<a name="SoupMessageBody.see-also"></a><h2>See Also</h2>
<a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>